#include "qpointfseditor.h"

#include "qpointfseditordialog.h"

#include "../property/qabstractproperty.h"

QPointFsEditor::QPointFsEditor(QAbstractProperty *property, QWidget *parent):
    QButtonCommonEditor(property,parent)
{
}

void QPointFsEditor::btn_clicked()
{
    QPointFsEditorDialog dlg(m_property->get_value(),m_property->get_property("name")=="line_points"?PT_LINE:PT_POLYGON,this);

    dlg.exec();

    if(dlg.get_ret()==1)
    {
        QVariant v=dlg.get_value();
        if(v!=m_property->get_value())
        {
            emit property_changed(v);
        }
    }
}

qRegisterPropertyEditor("PointFs",QPointFsEditor)
